import unittest

from parameterized import parameterized

from api.ihrm_login import Ihrm
from app import APP
from common.get_header import get_header
from common.ihrm_add_json import ihrm_add
from common.ihrm_login_assert import assert_login


class Ihrm_LoginB(unittest.TestCase):
    header = None

    @classmethod
    def setUpClass(cls) -> None:
        cls.header = get_header()

    josn = APP + "/data/ihrm_add.json"

    @parameterized.expand(ihrm_add(josn))
    def test01_ihrm(self, data_1, status_code, success, code, message):

        li = Ihrm.ihrm_add(self.header, data_1)
        print(li.json())
        assert_login(self, li, status_code, success, code, message)
